package com.server.modules.api.service;

import com.server.modules.api.dao.ApplyLoanAPIDao;
import com.server.modules.api.dao.LoanAPIDao;
import com.server.modules.api.dao.LoanMaterialtypeReAPIDao;

import com.server.modules.api.entity.LoanEx;
import com.server.modules.api.vo.FileVO;
import com.server.modules.api.vo.LoanListVo;
import com.server.modules.api.vo.LoanTypeListVo;
import com.server.modules.api.vo.MaterialTypeEx;
import com.server.modules.sys.entity.loan.Loan;
import com.server.modules.sys.entity.material.MaterialType;
import com.server.modules.sys.entity.material.MaterialUpload;
import com.server.modules.sys.service.loan.LoanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * Author Administrator
 * Date 2016/7/26
 */
@Service
public class LoanListAPIService extends LoanService {
	@Autowired
	protected LoanMaterialtypeReAPIDao loanMaterialtypeReAPIDao;

	@Autowired
	private LoanAPIDao loanAPIDao;

	@Autowired
	private ApplyLoanAPIDao applyLoanAPIDao;

	public List<MaterialTypeEx> getMaterialTypeByLoanId(LoanTypeListVo vo){
		return loanMaterialtypeReAPIDao.getMaterialTypeByLoanId(vo);
	}

	public  List<MaterialTypeEx> getMaterialDetailById(LoanTypeListVo vo){
		return loanMaterialtypeReAPIDao.getMaterialDetailById(vo);

	}
	public  Integer getMemberLoanCount(String memberId){
		return applyLoanAPIDao.getMemberLoanCount(memberId);
	}

	public  Double getMemberLoanSum(String memberId){
		return applyLoanAPIDao.getMemberLoanSum(memberId);
	}

	public List<Loan> getLoanList(LoanListVo loan){
		return loanAPIDao.findListByType(loan);
	}

	public List<MaterialUpload> getMaterialUpload(FileVO fileVO){
		return  loanMaterialtypeReAPIDao.getMaterialUpload(fileVO);
	}
}
